Tutorial Intermission

Sprucing up the Film class

In this section, you will make the Category and Rating fields into pop-up choices.  As the rest of the tutorial does not depend on you doing this now, you can skip this section and come back to it later.

Make sure that the Film class is open and in author mode.  If it is not open, click on the user classes folder and then double-click on Film.  If the alignment grid is not visible that means that the form is in user mode. Type the escape key to change to author mode.

•
Command-click on the category string field.
•
Choose View Options... from the pop-up menu.
•
Choose View Changer from the pop-up menu.
•
Choose pop-up choice view from the View Changer.
•
Click on Save & close the View Changer window.

The field will change into a pop-up choice.  Now edit the choices.

•
Command-click on the category pop-up choice.
•
Choose on Edit Choices from the pop-up menu.

A choice editor for the field will open.

•
Remove any existing choices in the list by clicking on them and then clicking Remove.
•
Click on Add and choose “abc”  to insert a string.
•
Edit the value (near the bottom of the window)  to “Mystery”.

Add 3 or 4 other film categories like Romance, Comedy, etc.  You  can click the Test button at any time to see what the menu will look like in use.  You can change an items position in the list by clicking on it in the list and then clicking on Up or Down.

You can check that your changes took effect by switching Film to user mode or by looking at one of the films in the film folder and trying the pop-up choice.

Fancy choices

For the Category choices, you used strings for the choices.  For the Rating choices, you will use one string for the rating itself, and another to display in the pop-up choice.  Although you could use the same string for both the rating and the display in the choice, having different strings allows the choice’s string to be more descriptive while the ranking itself is terse.

•
Double-click on Film in the user classes folder to open it.
•
Convert the rating field to a pop-up choice (as in the previous section) & open its choice editor.
•
Delete any items in the choice editor.
•
Create 5 titled choices using the Add button.

An titled choice has two properties of interest: a string and a value.  Its string  is displayed in the pop-up choice.  When a choice is made, the value is stored into the choice’s property.

•
Select a titled choice by clicking on it.
•
Change the display title for the  choice to "Must see - 5 stars".
•
Change the value for the first entry to "*****".

Edit the string and values for the other 4 entries.  Clicking on any entry will select it and allow it to be edited.  If inspiration escapes you, you might use “Great flick! - 4 stars”, “OK - 3 stars”, “Try to avoid - 2 stars”, and “Doggie - 1 star” for the other entries.

Note that you can set the value of a titled choice any value and not just to strings.  You do this by dragging and dropping the value to the right of the string field in which you entered the value above.

As in the previous section, you can check that your changes took effect by switching Film to user mode or by looking at one of the films in the film folder.